***** RUN DO_MASTER.do ***** do "$Do\DO_MASTER.do"

global program "OA_FigureB13"
cap log close
cap log using "$Log\log_$program$today", replace

**** REPLICATION OF FIGURE B.1.3 ****

clear all
set mem 2g
set more off
set maxvar 32000

// Import data

use $Data\data_news_voting, clear

***** 2A. SCATTER 547 - 467 *****

twoway (scatter oui oui_v467, msize(small) mcolor(gs10)) ///
	(lfit oui oui_v467, lcolor(black)), ///	
	ytitle("Minaret Ban", margin(tiny)) /// 
	yscale(r(0 100)) xscale(r(0 100)) ylabel(0(50)100, angle(0)) xlabel(0(50)100) ///
	subtitle("Sep 24, 2000") ///
	xtitle("Regulating Immigration", margin(medium)) ///	
	leg(lab(1 "Observed") lab(2 "Linear Fit") lab(3 "Equality Line") r(1) region(color(white)) symxsize(*0.5)) ///
	leg(off) name(v467, replace) graphregion(color(white)) xsize(5) ysize(5) 

***** 2B. SCATTER 547 - 491 *****

twoway (scatter oui oui_v491, msize(small) mcolor(gs10)) ///
	(lfit oui oui_v491, lcolor(black)), ///	
	ytitle("") /// 
	yscale(r(0 100)) xscale(r(0 100)) ylabel(0(50)100, angle(0)) xlabel(0(50)100) ///
	subtitle("Nov 24, 2002") ///	
	xtitle("Asylum Law ", margin(medium)) ///	
	leg(off) name(v491, replace) graphregion(color(white)) nodraw xsize(5) ysize(5)

***** 2A. SCATTER 547 - 510 *****

twoway (scatter oui oui_v510, msize(small) mcolor(gs10)) ///
	(lfit oui oui_v510, lcolor(black)), ///	
	yscale(r(0 100)) xscale(r(0 100)) ylabel(0(50)100, angle(0)) xlabel(0(50)100) ///
	subtitle("Sep 26, 2004") ///
	xtitle("Facilitated Naturalizations", margin(medium)) ///	
	leg(off) name(v510, replace) graphregion(color(white)) nodraw xsize(5) ysize(5)
	
***** 2A. SCATTER 547 - 532 *****

twoway (scatter oui oui_v532, msize(small) mcolor(gs10)) ///
	(lfit oui oui_v532, lcolor(black)), ///	
	ytitle("") /// 
	yscale(r(0 100)) xscale(r(0 100)) ylabel(0(50)100, angle(0)) xlabel(0(50)100) ///
	subtitle("Jun 01, 2008") ///
	xtitle("Democratic Naturalizations", margin(medium)) ///	
	leg(off) name(v532, replace) graphregion(color(white)) nodraw xsize(5) ysize(5)

grc1leg v467 v491 v510 v532, c(4) graphregion(color(white)) xcommon ycommon imargin(vsmall) legendfrom(v467)
graph export "$Results\\$program.png", replace width(8000) height(3000)

cap log close
